package com.edu.neusoft.student.domain;

import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class Salesrecord {

    @NotNull(message = "Sales record ID cannot be null")
    private Integer salesrecordid;

    @NotNull(message = "Order ID cannot be null")
    @Min(value = 1, message = "Order ID must be greater than 0")
    private Integer orderid;

    @NotNull(message = "Salesperson ID cannot be null")
    @Min(value = 1, message = "Salesperson ID must be greater than 0")
    private Integer salespersonid;

    @NotNull(message = "Sale date cannot be null")
    @PastOrPresent(message = "Sale date cannot be in the future")
    private Date saledate;

    @NotNull(message = "Sale amount cannot be null")
    @DecimalMin(value = "0.01", inclusive = true, message = "Sale amount must be at least 0.01")
    private BigDecimal saleamount;
}
